<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:with="title='商品管理',active='goods'">
<head th:replace="/manage/header::headerFragment(title,active)"></head>
<body>
<div th:replace="/manage/header::header-body"></div>
<div class="row">
  <div class="col-2">
    <div th:replace="/manage/leftnav::leftnav"></div>
  </div>
  <div class="col-10 content-page">
    <h2 class="sub-header" th:text="添加商品"></h2>
    <div class="col-sm-6 col-sm-offset-3 col-md-8 col-md-offset-2">

      <form class="form" role="form" method="post" th:object="${goods}" th:action="@{'/manage/goods/doHandleGoods'}" enctype="multipart/form-data">

        <input type="hidden" id="goodsId" name="goods_id" th:field="*{goods_id}"/>
        <div class="form-group">
          <label for="cateId">  所属商品类别</label>
          <select class="form-control input-sm" th:field="*{cate_id}"  id="cateId">
            <option th:each="cate :${cates}" th:value="${cate.cate_id }" th:selected="${goods.cate_id==cate.cate_id}" th:text="${cate.cate_name}"></option>
          </select>
        </div>
        <div class="form-group">
          <label for="goodsName"> 商品名称 </label>
          <input class="form-control" name="goods_name" id="goodsName" th:field="*{goods_name}" type="text"  placeholder="商品名称" required/>
        </div>
        <div class="form-group">
          <label for="goodsDisc"> 商品描述 </label>
          <textarea class="form-control" name="goods_disc" id="goodsDisc" rows="3" placeholder="商品描述" required th:field="*{goods_disc}"></textarea>
        </div>
        <div class="form-group">
          <label for="goodsPrice"> 商品原价</label>
          <input class="form-control" name="goods_price" id="goodsPrice" th:field="*{goods_price}" type="text"  placeholder="商品原价" required/>
        </div>
        <div class="form-group">
          <label for="goodsDiscount"> 商品折后价格 </label>
          <input class="form-control" name="goods_discount" id="goodsDiscount" th:field="*{goods_discount}" type="text"  placeholder="商品折后价格" required/>
        </div>
        <div class="form-group">
          <label for="goodsStock"> 商品库存 </label>
          <input class="form-control" name="goods_stock" id="goodsStock"  th:field="*{goods_stock}" type="number"  placeholder="商品库存"  required/>
        </div>
        <div class="form-group">
          <label for="goodsOrigin"> 商品产地 </label>
          <input class="form-control" name="goods_origin" id="goodsOrigin" th:field="*{goods_origin}" type="text"  placeholder="商品产地" required/>
        </div>
        <div class="form-group">
          <label for="goodsMaterial"> 商品材质</label>
          <input class="form-control" name="goods_material" id="goodsMaterial" th:field="*{goods_material}" type="text"  placeholder="商品材质" required/>
        </div>
        <div class="form-group">
          <label for="goodsPostalfee"> 商品运费</label>
          <input class="form-control" name="goods_postalfee" id="goodsPostalfee" th:field="*{goods_postalfee}" type="number"  placeholder="商品运费" required/>
        </div>
        <div class="form-group">
          <label for="goodsSales"> 商品销量</label>
          <input class="form-control" name="goods_sales" id="goodsSales" th:value="${goods.goods_sales}" type="number"  placeholder="商品销量" disabled required/>
        </div>
        <div class="form-group" id="goodsPicDiv">
          <label> 商品图片</label>
          <input class="form-control" name="goodsPicFile" id="goodsPicFile" type="file"  required/>
        </div>
        <div class="form-group">
          <button class="btn btn-primary" type="submit" >确定</button>
          <button class="btn btn-default" type="reset" >重置</button>
        </div>
      </form>
    </div>



  </div>
</div>>

<div th:replace="/manage/footer::footer"></div>
</body>
</html>